import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int[] arr=new int[n];
        int sum=0;
        for(int i=0;i<n;i++){
            arr[i]=sc.nextInt();
        }
        for(int i=0;i<k;i++){
            int r=0;
            while(arr[r]%2!=0){
                r++;
            }
            int max=arr[r];
            for(int j=r+1;j<n;j++){
                if(arr[j]%2==0&&arr[j]>max){
                    r=j;
                    max=arr[j];
                }
            }
            arr[r]/=2;
        }
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    }
    public static void main2(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int x=sc.nextInt();
        int[] arr=new int[n];
        for(int i=0;i<n;i++) {
            arr[i] = sc.nextInt();
        }
        int[] min=new int[n];
        int m=0;
        int[] res1=new int[n];
        int[] res=new int[n];
        for(int i=0;i<n;i++){
            int sum=0;
            for(int j=i;j<n;j++){
                sum+=arr[j];
                if(sum>=x){
                    res[m]=i;
                    res1[m]=j;
                    min[m]=res1[m]-res[m]+1;
                    m++;
                    break;
                }
            }
        }
        int rum=0,rum1=0;
        int minn=min[0];
        for(int i=1;i<n;i++){
            if(minn>min[i]&&min[i]>0){
                minn=min[i];
                rum=res[i];
                rum1=res1[i];
            }
        }
        System.out.println(rum+1+" "+rum1+1);
    }
    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        String[] str1=str.split(" ");
        char[] ch=new char[str1.length];
        for(int i=0;i<str1.length;i++){
            if(str1[i].charAt(0)>='a'&&str1[i].charAt(0)<='z'){
                ch[i]=(char)(str1[i].charAt(0)-32);
            }else{
                ch[i]=str1[i].charAt(0);
            }
        }
        for(char x:ch){
            System.out.print(x);
        }
    }
}